Model View Controller² [closed]
Posted
by
user694971
on Programmers
See other posts from Programmers
or by user694971
Published on 2012-09-27T17:06:17Z
Indexed on
2012/09/27
21:50 UTC
Read the original article
Hit count: 148
I am working on a quite complex web application in Go and I tried to stay in an MVC pattern. However, I ended up having a structure isomorphic to this:
/boilerplate The usual boilerplate an application needs to survive in the wilderness
/db Layer talking to an SQL DB
/helpers Helpers
/logic Backend logic, not directly affiliated with any routes, sessions etc.
/templates View
/web Glue between /logic and /templates.
In more dynamic languages the size of /web would be next to zero. But Go doesn't exactly have a RoR integrated so I need a lot of helper structures to feed the templates with data, to process GET/POST parameters and session information.
I remember once reading about patterns similar to MVC with one extra letter but Wiki-searching I couldn't find it right now.
(BTW currently /logic also contains data retrieval from API services to fill some hash maps; this is no simple task, but that probably belongs into the model, right?)
So question: is this structure considered sane? Or does it need some bending to be tagged MVC app?
© Programmers or respective owner